[PATCH] MAINT: test_anova.py fails on pandas 0.19.0 because stringio closes after...
authorthequackdaddy <pquack@gmail.com>
Tue, 20 Dec 2016 16:10:22 +0000 (10:10 -0600)
committerOle Streicher <olebole@debian.org>
Mon, 26 Dec 2016 17:33:56 +0000 (17:33 +0000)
Gbp-Pq: Name workaround_panda_readtable_bug.patch

statsmodels/stats/tests/test_anova.py

index 09c0a0ad67c86a27df90c615b5da960a74f1cb3e..e236efeace2709b3456b9ca312971057330698af 100644 (file)
@@ -71,13 +71,15 @@ kidney_table = StringIO("""Days      Duration Weight ID
     1.0      2      3     10
 """)
 
+kidney_table.seek(0)
+kidney_table = read_table(kidney_table, sep="\s+")
+
 class TestAnovaLM(object):
     @classmethod
     def setupClass(cls):
         # kidney data taken from JT's course
         # don't know the license
-        kidney_table.seek(0)
-        cls.data = read_table(kidney_table, sep="\s+")
+        cls.data = kidney_table
         cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight)',
                         data=cls.data).fit()
 
@@ -100,8 +102,7 @@ class TestAnovaLMNoconstant(object):
     def setupClass(cls):
         # kidney data taken from JT's course
         # don't know the license
-        kidney_table.seek(0)
-        cls.data = read_table(kidney_table, sep="\s+")
+        cls.data = kidney_table
         cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight) - 1',
                         data=cls.data).fit()